<template>
	<view class="container">
		<view class="list-item" v-for="(item,index) in applyList" :key="index">
			<view class="up">
				<view>
					<text>{{item.name}}</text>
				</view>
				<view>
					<text>产品数：{{item.productIds.length}}</text>
				</view>
			</view>
			<view class="down">
				<view>
					<text>{{item.telephone}}</text>
					
				</view>
				<view>
					<text>改造地址：</text>
					<text>{{item.detailedAddress}}</text>
				</view>
				<view class="btn">
					<text>撤销申请</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserApply
	} from "../../../common/request.js"

	export default {
		data() {
			return {
				applyList: []
			};
		},
		methods: {
			getUserApplyMsg() {
				getUserApply(this.$store.state.user.userId).then(res => {
					console.log(res);
					this.applyList = res
				})
			}
		},
		created() {
			this.getUserApplyMsg()
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		height: 100%;

		.list-item {
			display: flex;
			font-size: 30rpx;
			margin: 20rpx;
			padding: 20rpx;
			border-radius: 10rpx;

			.up {
				color: white;
				padding: 20rpx;
				width: 220rpx;
				height: 250rpx;
				// background-color: red;
				/* 浏览器不支持时显示 */
				// background-image: url(../../home/bg.jpg);
				background-image: linear-gradient(#ff9a44, #fe7b5f);;
				justify-content: space-around;
				margin-bottom: 10rpx;
				border-radius: 10rpx;
				view:nth-of-type(1) {
					margin-top: 10rpx;
					font-size: 36rpx;
				}
				view:nth-of-type(2) {
					margin-top: 10rpx;
				}
			}

			.down {
				border-radius: 10rpx;
				padding: 20rpx;
				width: 450rpx;
				height: 240rpx;
				box-shadow: 4px 4px 5px #999;
				// background-color: #eee;
				text-align: center;

				view:nth-of-type(2) {
					margin-top: 10rpx;
				}
				.btn{
					position: relative;
					top: 15rpx;
					left: 200rpx;
					color:$uni-color-home-yellow;
					width: 150rpx;
					height: 60rpx;
					padding: 10rpx 10rpx;
					border: $uni-color-home-yellow solid 3rpx;
					font-size: 24rpx;
					border-radius: 15rpx;
				}
			}
		}
	}
</style>
